package org.luxor.common.kettle.config.properties;

import org.pentaho.di.core.logging.LogLevel;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Kettle 全局配置
 *
 * @author Mr.Yan  @date: 2022/04/06
 */
@ConfigurationProperties(prefix = KettleProperties.PREFIX)
public class KettleProperties {
    public static final String PREFIX = "spring.kettle";

    private final Boolean DEFAULT_ENABLED = Boolean.TRUE;

    private final String DEFAULT_SCRIPT_LOCATION_PREFIX = "kettle-script/";

    /**
     * 是否启用
     */
    private boolean enabled;

    /**
     * 脚本路径前缀
     */
    private String scriptLocationPrefix;


    private LogLevel logLevel;

    public KettleProperties() {
        this.enabled = DEFAULT_ENABLED.booleanValue();
        this.scriptLocationPrefix = DEFAULT_SCRIPT_LOCATION_PREFIX;
        this.logLevel = LogLevel.BASIC;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getScriptLocationPrefix() {
        return scriptLocationPrefix;
    }

    public void setScriptLocationPrefix(String scriptLocationPrefix) {
        this.scriptLocationPrefix = scriptLocationPrefix;
    }

    public LogLevel getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(LogLevel logLevel) {
        this.logLevel = logLevel;
    }
}
